﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace ThesisSystem.Models
{
    public class Student
    {
        [Key]
        public Guid UserID { get; set; }

        [Display(Name="学号")]
        [Required(ErrorMessage="*")]
        [RegularExpression(@"\d{12}",ErrorMessage="格式不对")]
        public string StudentID { get; set; }

        [StringLength(50)]
        [Required(ErrorMessage = "*")]
        [DisplayName("学生姓名")]
        public string Name { get; set; }

        [DisplayName("相片")]
        public string Photo { get; set; }

        [StringLength(4)]
        [Required(ErrorMessage = "*")]
        [DisplayName("性别")]
        public string Sex { get; set; }

 
        [DisplayName("身份证")]
        [RegularExpression(@"\d{17}[0-9Xx]|\d{14}[0-9Xx]",ErrorMessage="格式不对")]
        public string PostCard { get; set; }

        [StringLength(20)]
        [Required(ErrorMessage = "*")]
        [DisplayName("民族")]
        public string Nationality { get; set; }

        [StringLength(100)]
        [Required(ErrorMessage = "*")]
        [DisplayName("籍 贯")]
        public string BirthPlace { get; set; }


        [DisplayName("政治面貌")]
        public string PoliticalLandscape { get; set; }

   
        [DisplayName("联系电话")]
        //[RegularExpression(@"\d",ErrorMessage="格式不对")]
        public string Telephone { get; set; }

        [DisplayName("入学时间")]
        public DateTime? EnrolmentDate { get; set; }

        [StringLength(30)]
        [Required(ErrorMessage = "*")]
        [DisplayName("录取专业")]
        public string AdmitProfessional { get; set; }

        [StringLength(30)]
        [Required(ErrorMessage = "*")]
        [DisplayName("所学专业")]
        public string StudyProfessional { get; set; }

        [DisplayName("学制")]
        [Required(ErrorMessage = "*")]
        public int EducationalSystem { get; set; }

        [StringLength(10)]
        [Required(ErrorMessage = "*")]
        [DisplayName("本科/专科")]
        public string EducationLevel { get; set; }

  
        [DisplayName("系部")]
        public int DepartmentID { get; set; }

       
        [DisplayName("班级")]
        [ForeignKey("GClass")]
        public int ClassID { get; set; }

        [DisplayName("辅修专业")]
        public string ExtraProfession { get; set; }

        [DisplayName("备注")]
        public string Remark { get; set; }

        [DisplayName("学生分组编号")]
        public int? StudentGroupID { get; set; }

        [ForeignKey("Teacher")]
        public Guid? TeacherUserID { get; set; }

        //一个学生对应一篇论文
        //public virtual Thesis Thesis { get; set; }

        //一个学生由一个教师指导
        public virtual Teacher Teacher { get; set; }

        public virtual GClass GClass { get; set; }

        public virtual Department Department { get; set; }

        public virtual StudentGroup StudentGroup { get; set; }

        //public virtual Profession Profession { get; set; }
    }
}
